; generated by ARM C/C++ Compiler, 4.1 [Build 481]
; commandline ArmCC [--split_sections --debug -c --asm --interleave -o..\OUT\stm32f10x_dac.o --depend=..\OUT\stm32f10x_dac.d --cpu=Cortex-M3 --apcs=interwork -O0 -I..\Libraries\inc -I..\CMSIS -I..\users -I..\Libraries\src -I..\Libraries\sys -I..\COMM -I..\MOD -I..\CAN -IC:\Keil\ARM\INC -IC:\Keil\ARM\INC\ST\STM32F10x -D__MICROLIB -DSTM32F10X_HD -DUSE_STDPERIPH_DRIVER --omf_browse=..\OUT\stm32f10x_dac.crf ..\Libraries\src\stm32f10x_dac.c]
                          THUMB

                          AREA ||i.DAC_Cmd||, CODE, READONLY, ALIGN=2

                  DAC_Cmd PROC
;;;172      */
;;;173    void DAC_Cmd(uint32_t DAC_Channel, FunctionalState NewState)
000000  b159              CBZ      r1,|L1.26|
;;;174    {
;;;175      /* Check the parameters */
;;;176      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;177      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;178      if (NewState != DISABLE)
;;;179      {
;;;180        /* Enable the selected DAC channel */
;;;181        DAC->CR |= (DAC_CR_EN1 << DAC_Channel);
000002  4a0c              LDR      r2,|L1.52|
000004  6812              LDR      r2,[r2,#0]
000006  f04f0301          MOV      r3,#1
00000a  fa03f300          LSL      r3,r3,r0
00000e  ea420203          ORR      r2,r2,r3
000012  4b09              LDR      r3,|L1.56|
000014  f8c32400          STR      r2,[r3,#0x400]
000018  e00a              B        |L1.48|
                  |L1.26|
;;;182      }
;;;183      else
;;;184      {
;;;185        /* Disable the selected DAC channel */
;;;186        DAC->CR &= ~(DAC_CR_EN1 << DAC_Channel);
00001a  4a06              LDR      r2,|L1.52|
00001c  6812              LDR      r2,[r2,#0]
00001e  f04f0301          MOV      r3,#1
000022  fa03f300          LSL      r3,r3,r0
000026  ea220203          BIC      r2,r2,r3
00002a  4b03              LDR      r3,|L1.56|
00002c  f8c32400          STR      r2,[r3,#0x400]
                  |L1.48|
;;;187      }
;;;188    }
000030  4770              BX       lr
;;;189    #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
                          ENDP

000032  0000              DCW      0x0000
                  |L1.52|
                          DCD      0x40007400
                  |L1.56|
                          DCD      0x40007000

                          AREA ||i.DAC_DMACmd||, CODE, READONLY, ALIGN=2

                  DAC_DMACmd PROC
;;;232      */
;;;233    void DAC_DMACmd(uint32_t DAC_Channel, FunctionalState NewState)
000000  b159              CBZ      r1,|L2.26|
;;;234    {
;;;235      /* Check the parameters */
;;;236      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;237      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;238      if (NewState != DISABLE)
;;;239      {
;;;240        /* Enable the selected DAC channel DMA request */
;;;241        DAC->CR |= (DAC_CR_DMAEN1 << DAC_Channel);
000002  4a0c              LDR      r2,|L2.52|
000004  6812              LDR      r2,[r2,#0]
000006  f44f5380          MOV      r3,#0x1000
00000a  fa03f300          LSL      r3,r3,r0
00000e  ea420203          ORR      r2,r2,r3
000012  4b09              LDR      r3,|L2.56|
000014  f8c32400          STR      r2,[r3,#0x400]
000018  e00a              B        |L2.48|
                  |L2.26|
;;;242      }
;;;243      else
;;;244      {
;;;245        /* Disable the selected DAC channel DMA request */
;;;246        DAC->CR &= ~(DAC_CR_DMAEN1 << DAC_Channel);
00001a  4a06              LDR      r2,|L2.52|
00001c  6812              LDR      r2,[r2,#0]
00001e  f44f5380          MOV      r3,#0x1000
000022  fa03f300          LSL      r3,r3,r0
000026  ea220203          BIC      r2,r2,r3
00002a  4b03              LDR      r3,|L2.56|
00002c  f8c32400          STR      r2,[r3,#0x400]
                  |L2.48|
;;;247      }
;;;248    }
000030  4770              BX       lr
;;;249    
                          ENDP

000032  0000              DCW      0x0000
                  |L2.52|
                          DCD      0x40007400
                  |L2.56|
                          DCD      0x40007000

                          AREA ||i.DAC_DeInit||, CODE, READONLY, ALIGN=1

                  DAC_DeInit PROC
;;;97       */
;;;98     void DAC_DeInit(void)
000000  b510              PUSH     {r4,lr}
;;;99     {
;;;100      /* Enable DAC reset state */
;;;101      RCC_APB1PeriphResetCmd(RCC_APB1Periph_DAC, ENABLE);
000002  2101              MOVS     r1,#1
000004  0748              LSLS     r0,r1,#29
000006  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;102      /* Release DAC from reset state */
;;;103      RCC_APB1PeriphResetCmd(RCC_APB1Periph_DAC, DISABLE);
00000a  2100              MOVS     r1,#0
00000c  f04f5000          MOV      r0,#0x20000000
000010  f7fffffe          BL       RCC_APB1PeriphResetCmd
;;;104    }
000014  bd10              POP      {r4,pc}
;;;105    
                          ENDP


                          AREA ||i.DAC_DualSoftwareTriggerCmd||, CODE, READONLY, ALIGN=2

                  DAC_DualSoftwareTriggerCmd PROC
;;;283      */
;;;284    void DAC_DualSoftwareTriggerCmd(FunctionalState NewState)
000000  b138              CBZ      r0,|L4.18|
;;;285    {
;;;286      /* Check the parameters */
;;;287      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;288      if (NewState != DISABLE)
;;;289      {
;;;290        /* Enable software trigger for both DAC channels */
;;;291        DAC->SWTRIGR |= DUAL_SWTRIG_SET ;
000002  4908              LDR      r1,|L4.36|
000004  6809              LDR      r1,[r1,#0]
000006  f0410103          ORR      r1,r1,#3
00000a  4a07              LDR      r2,|L4.40|
00000c  f8c21404          STR      r1,[r2,#0x404]
000010  e006              B        |L4.32|
                  |L4.18|
;;;292      }
;;;293      else
;;;294      {
;;;295        /* Disable software trigger for both DAC channels */
;;;296        DAC->SWTRIGR &= DUAL_SWTRIG_RESET;
000012  4904              LDR      r1,|L4.36|
000014  6809              LDR      r1,[r1,#0]
000016  f0210103          BIC      r1,r1,#3
00001a  4a03              LDR      r2,|L4.40|
00001c  f8c21404          STR      r1,[r2,#0x404]
                  |L4.32|
;;;297      }
;;;298    }
000020  4770              BX       lr
;;;299    
                          ENDP

000022  0000              DCW      0x0000
                  |L4.36|
                          DCD      0x40007404
                  |L4.40|
                          DCD      0x40007000

                          AREA ||i.DAC_GetDataOutputValue||, CODE, READONLY, ALIGN=2

                  DAC_GetDataOutputValue PROC
;;;429      */
;;;430    uint16_t DAC_GetDataOutputValue(uint32_t DAC_Channel)
000000  4601              MOV      r1,r0
;;;431    {
;;;432      __IO uint32_t tmp = 0;
000002  2200              MOVS     r2,#0
;;;433      
;;;434      /* Check the parameters */
;;;435      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;436      
;;;437      tmp = (uint32_t) DAC_BASE ;
000004  4a03              LDR      r2,|L5.20|
;;;438      tmp += DOR_OFFSET + ((uint32_t)DAC_Channel >> 2);
000006  202c              MOVS     r0,#0x2c
000008  eb000091          ADD      r0,r0,r1,LSR #2
00000c  4402              ADD      r2,r2,r0
;;;439      
;;;440      /* Returns the DAC channel data output register value */
;;;441      return (uint16_t) (*(__IO uint32_t*) tmp);
00000e  6810              LDR      r0,[r2,#0]
000010  b280              UXTH     r0,r0
;;;442    }
000012  4770              BX       lr
;;;443    
                          ENDP

                  |L5.20|
                          DCD      0x40007400

                          AREA ||i.DAC_Init||, CODE, READONLY, ALIGN=2

                  DAC_Init PROC
;;;116      */
;;;117    void DAC_Init(uint32_t DAC_Channel, DAC_InitTypeDef* DAC_InitStruct)
000000  b530              PUSH     {r4,r5,lr}
;;;118    {
;;;119      uint32_t tmpreg1 = 0, tmpreg2 = 0;
000002  2200              MOVS     r2,#0
000004  2300              MOVS     r3,#0
;;;120      /* Check the DAC parameters */
;;;121      assert_param(IS_DAC_TRIGGER(DAC_InitStruct->DAC_Trigger));
;;;122      assert_param(IS_DAC_GENERATE_WAVE(DAC_InitStruct->DAC_WaveGeneration));
;;;123      assert_param(IS_DAC_LFSR_UNMASK_TRIANGLE_AMPLITUDE(DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude));
;;;124      assert_param(IS_DAC_OUTPUT_BUFFER_STATE(DAC_InitStruct->DAC_OutputBuffer));
;;;125    /*---------------------------- DAC CR Configuration --------------------------*/
;;;126      /* Get the DAC CR value */
;;;127      tmpreg1 = DAC->CR;
000006  4c0d              LDR      r4,|L6.60|
000008  6822              LDR      r2,[r4,#0]
;;;128      /* Clear BOFFx, TENx, TSELx, WAVEx and MAMPx bits */
;;;129      tmpreg1 &= ~(CR_CLEAR_MASK << DAC_Channel);
00000a  f64074fe          MOV      r4,#0xffe
00000e  fa04f400          LSL      r4,r4,r0
000012  ea220204          BIC      r2,r2,r4
;;;130      /* Configure for the selected DAC channel: buffer output, trigger, wave generation,
;;;131         mask/amplitude for wave generation */
;;;132      /* Set TSELx and TENx bits according to DAC_Trigger value */
;;;133      /* Set WAVEx bits according to DAC_WaveGeneration value */
;;;134      /* Set MAMPx bits according to DAC_LFSRUnmask_TriangleAmplitude value */ 
;;;135      /* Set BOFFx bit according to DAC_OutputBuffer value */   
;;;136      tmpreg2 = (DAC_InitStruct->DAC_Trigger | DAC_InitStruct->DAC_WaveGeneration |
000016  e9d14500          LDRD     r4,r5,[r1,#0]
00001a  ea440405          ORR      r4,r4,r5
00001e  688d              LDR      r5,[r1,#8]
000020  ea440405          ORR      r4,r4,r5
000024  68cd              LDR      r5,[r1,#0xc]
000026  ea440305          ORR      r3,r4,r5
;;;137                 DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude | DAC_InitStruct->DAC_OutputBuffer);
;;;138      /* Calculate CR register value depending on DAC_Channel */
;;;139      tmpreg1 |= tmpreg2 << DAC_Channel;
00002a  fa03f400          LSL      r4,r3,r0
00002e  ea440202          ORR      r2,r4,r2
;;;140      /* Write to DAC CR */
;;;141      DAC->CR = tmpreg1;
000032  4c03              LDR      r4,|L6.64|
000034  f8c42400          STR      r2,[r4,#0x400]
;;;142    }
000038  bd30              POP      {r4,r5,pc}
;;;143    
                          ENDP

00003a  0000              DCW      0x0000
                  |L6.60|
                          DCD      0x40007400
                  |L6.64|
                          DCD      0x40007000

                          AREA ||i.DAC_SetChannel1Data||, CODE, READONLY, ALIGN=2

                  DAC_SetChannel1Data PROC
;;;341      */
;;;342    void DAC_SetChannel1Data(uint32_t DAC_Align, uint16_t Data)
000000  2200              MOVS     r2,#0
;;;343    {  
;;;344      __IO uint32_t tmp = 0;
;;;345      
;;;346      /* Check the parameters */
;;;347      assert_param(IS_DAC_ALIGN(DAC_Align));
;;;348      assert_param(IS_DAC_DATA(Data));
;;;349      
;;;350      tmp = (uint32_t)DAC_BASE; 
000002  4a03              LDR      r2,|L7.16|
;;;351      tmp += DHR12R1_OFFSET + DAC_Align;
000004  f1000308          ADD      r3,r0,#8
000008  441a              ADD      r2,r2,r3
;;;352    
;;;353      /* Set the DAC channel1 selected data holding register */
;;;354      *(__IO uint32_t *) tmp = Data;
00000a  6011              STR      r1,[r2,#0]
;;;355    }
00000c  4770              BX       lr
;;;356    
                          ENDP

00000e  0000              DCW      0x0000
                  |L7.16|
                          DCD      0x40007400

                          AREA ||i.DAC_SetChannel2Data||, CODE, READONLY, ALIGN=2

                  DAC_SetChannel2Data PROC
;;;366      */
;;;367    void DAC_SetChannel2Data(uint32_t DAC_Align, uint16_t Data)
000000  2200              MOVS     r2,#0
;;;368    {
;;;369      __IO uint32_t tmp = 0;
;;;370    
;;;371      /* Check the parameters */
;;;372      assert_param(IS_DAC_ALIGN(DAC_Align));
;;;373      assert_param(IS_DAC_DATA(Data));
;;;374      
;;;375      tmp = (uint32_t)DAC_BASE;
000002  4a03              LDR      r2,|L8.16|
;;;376      tmp += DHR12R2_OFFSET + DAC_Align;
000004  f1000314          ADD      r3,r0,#0x14
000008  441a              ADD      r2,r2,r3
;;;377    
;;;378      /* Set the DAC channel2 selected data holding register */
;;;379      *(__IO uint32_t *)tmp = Data;
00000a  6011              STR      r1,[r2,#0]
;;;380    }
00000c  4770              BX       lr
;;;381    
                          ENDP

00000e  0000              DCW      0x0000
                  |L8.16|
                          DCD      0x40007400

                          AREA ||i.DAC_SetDualChannelData||, CODE, READONLY, ALIGN=2

                  DAC_SetDualChannelData PROC
;;;395      */
;;;396    void DAC_SetDualChannelData(uint32_t DAC_Align, uint16_t Data2, uint16_t Data1)
000000  b530              PUSH     {r4,r5,lr}
;;;397    {
;;;398      uint32_t data = 0, tmp = 0;
000002  2400              MOVS     r4,#0
000004  2300              MOVS     r3,#0
;;;399      
;;;400      /* Check the parameters */
;;;401      assert_param(IS_DAC_ALIGN(DAC_Align));
;;;402      assert_param(IS_DAC_DATA(Data1));
;;;403      assert_param(IS_DAC_DATA(Data2));
;;;404      
;;;405      /* Calculate and set dual DAC data holding register value */
;;;406      if (DAC_Align == DAC_Align_8b_R)
000006  2808              CMP      r0,#8
000008  d102              BNE      |L9.16|
;;;407      {
;;;408        data = ((uint32_t)Data2 << 8) | Data1; 
00000a  ea422401          ORR      r4,r2,r1,LSL #8
00000e  e001              B        |L9.20|
                  |L9.16|
;;;409      }
;;;410      else
;;;411      {
;;;412        data = ((uint32_t)Data2 << 16) | Data1;
000010  ea424401          ORR      r4,r2,r1,LSL #16
                  |L9.20|
;;;413      }
;;;414      
;;;415      tmp = (uint32_t)DAC_BASE;
000014  4b02              LDR      r3,|L9.32|
;;;416      tmp += DHR12RD_OFFSET + DAC_Align;
000016  f1000520          ADD      r5,r0,#0x20
00001a  442b              ADD      r3,r3,r5
;;;417    
;;;418      /* Set the dual DAC selected data holding register */
;;;419      *(__IO uint32_t *)tmp = data;
00001c  601c              STR      r4,[r3,#0]
;;;420    }
00001e  bd30              POP      {r4,r5,pc}
;;;421    
                          ENDP

                  |L9.32|
                          DCD      0x40007400

                          AREA ||i.DAC_SoftwareTriggerCmd||, CODE, READONLY, ALIGN=2

                  DAC_SoftwareTriggerCmd PROC
;;;259      */
;;;260    void DAC_SoftwareTriggerCmd(uint32_t DAC_Channel, FunctionalState NewState)
000000  b510              PUSH     {r4,lr}
;;;261    {
;;;262      /* Check the parameters */
;;;263      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;264      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;265      if (NewState != DISABLE)
000002  b169              CBZ      r1,|L10.32|
;;;266      {
;;;267        /* Enable software trigger for the selected DAC channel */
;;;268        DAC->SWTRIGR |= (uint32_t)DAC_SWTRIGR_SWTRIG1 << (DAC_Channel >> 4);
000004  4a0d              LDR      r2,|L10.60|
000006  6812              LDR      r2,[r2,#0]
000008  ea4f1410          LSR      r4,r0,#4
00000c  f04f0301          MOV      r3,#1
000010  fa03f304          LSL      r3,r3,r4
000014  ea420203          ORR      r2,r2,r3
000018  4b09              LDR      r3,|L10.64|
00001a  f8c32404          STR      r2,[r3,#0x404]
00001e  e00c              B        |L10.58|
                  |L10.32|
;;;269      }
;;;270      else
;;;271      {
;;;272        /* Disable software trigger for the selected DAC channel */
;;;273        DAC->SWTRIGR &= ~((uint32_t)DAC_SWTRIGR_SWTRIG1 << (DAC_Channel >> 4));
000020  4a06              LDR      r2,|L10.60|
000022  6812              LDR      r2,[r2,#0]
000024  ea4f1410          LSR      r4,r0,#4
000028  f04f0301          MOV      r3,#1
00002c  fa03f304          LSL      r3,r3,r4
000030  ea220203          BIC      r2,r2,r3
000034  4b02              LDR      r3,|L10.64|
000036  f8c32404          STR      r2,[r3,#0x404]
                  |L10.58|
;;;274      }
;;;275    }
00003a  bd10              POP      {r4,pc}
;;;276    
                          ENDP

                  |L10.60|
                          DCD      0x40007404
                  |L10.64|
                          DCD      0x40007000

                          AREA ||i.DAC_StructInit||, CODE, READONLY, ALIGN=1

                  DAC_StructInit PROC
;;;149      */
;;;150    void DAC_StructInit(DAC_InitTypeDef* DAC_InitStruct)
000000  2100              MOVS     r1,#0
;;;151    {
;;;152    /*--------------- Reset DAC init structure parameters values -----------------*/
;;;153      /* Initialize the DAC_Trigger member */
;;;154      DAC_InitStruct->DAC_Trigger = DAC_Trigger_None;
000002  6001              STR      r1,[r0,#0]
;;;155      /* Initialize the DAC_WaveGeneration member */
;;;156      DAC_InitStruct->DAC_WaveGeneration = DAC_WaveGeneration_None;
000004  6041              STR      r1,[r0,#4]
;;;157      /* Initialize the DAC_LFSRUnmask_TriangleAmplitude member */
;;;158      DAC_InitStruct->DAC_LFSRUnmask_TriangleAmplitude = DAC_LFSRUnmask_Bit0;
000006  6081              STR      r1,[r0,#8]
;;;159      /* Initialize the DAC_OutputBuffer member */
;;;160      DAC_InitStruct->DAC_OutputBuffer = DAC_OutputBuffer_Enable;
000008  60c1              STR      r1,[r0,#0xc]
;;;161    }
00000a  4770              BX       lr
;;;162    
                          ENDP


                          AREA ||i.DAC_WaveGenerationCmd||, CODE, READONLY, ALIGN=2

                  DAC_WaveGenerationCmd PROC
;;;313      */
;;;314    void DAC_WaveGenerationCmd(uint32_t DAC_Channel, uint32_t DAC_Wave, FunctionalState NewState)
000000  b510              PUSH     {r4,lr}
;;;315    {
;;;316      /* Check the parameters */
;;;317      assert_param(IS_DAC_CHANNEL(DAC_Channel));
;;;318      assert_param(IS_DAC_WAVE(DAC_Wave)); 
;;;319      assert_param(IS_FUNCTIONAL_STATE(NewState));
;;;320      if (NewState != DISABLE)
000002  b14a              CBZ      r2,|L12.24|
;;;321      {
;;;322        /* Enable the selected wave generation for the selected DAC channel */
;;;323        DAC->CR |= DAC_Wave << DAC_Channel;
000004  4b09              LDR      r3,|L12.44|
000006  681b              LDR      r3,[r3,#0]
000008  fa01f400          LSL      r4,r1,r0
00000c  ea430304          ORR      r3,r3,r4
000010  4c07              LDR      r4,|L12.48|
000012  f8c43400          STR      r3,[r4,#0x400]
000016  e008              B        |L12.42|
                  |L12.24|
;;;324      }
;;;325      else
;;;326      {
;;;327        /* Disable the selected wave generation for the selected DAC channel */
;;;328        DAC->CR &= ~(DAC_Wave << DAC_Channel);
000018  4b04              LDR      r3,|L12.44|
00001a  681b              LDR      r3,[r3,#0]
00001c  fa01f400          LSL      r4,r1,r0
000020  ea230304          BIC      r3,r3,r4
000024  4c02              LDR      r4,|L12.48|
000026  f8c43400          STR      r3,[r4,#0x400]
                  |L12.42|
;;;329      }
;;;330    }
00002a  bd10              POP      {r4,pc}
;;;331    
                          ENDP

                  |L12.44|
                          DCD      0x40007400
                  |L12.48|
                          DCD      0x40007000
